// pages/aiplaint/plaintearth.ts

import { getRandList } from "../../utils/data/data";

Page({
  /**
   * 组件的初始数据
   */
  data: {
    interestList:new Array<string>(),
    destination:'',
    days:'7天',
    dudget:'标准',
    dudgets:['节约','标准','豪华'],
    dudgetShow:false,
    tuijDestination:['北京','香港','纽约','伦敦'],
    userInterst:[]
  },
  onShow(){
    const list = this.data.interestList
    if(list.length != 0){
      return
    }
    list.push('城市漫步')
    list.push('美食')
    list.push('畅饮')
    list.push('咖啡')
    list.push('购物')
    list.push('自驾')
    list.push('艺术与文化')
    list.push('骑自行车')
    list.push('海滩')
    list.push('高尔夫')
    list.push('品酒')
    this.setData({interestList:list})
  },
  onRandomClick(_:any){
      const dsp = getRandList()
      this.setData({destination:dsp})
  },
  onDudgetClick(_e:any){
    console.log(_e)
    this.setData({dudgetShow:true})
  },
  onDudgetConfirm(e:any){
    const value = e.detail.value
    this.setData({dudgetShow:false, dudget:value})
  },
  onDudgetCancel(_e:any){
    this.setData({dudgetShow:false})
  },
  onInterstChange(e:any){
    this.setData({
      userInterst: e.detail,
    });
  }
})